% /*******************************************************************************
%  * Hybrid Correction Method : main routine
%  * *****************************************************************************
%  * @param a
%  * @param b
%  * @param m
%  * @param n
%  * @param r
%  * @param k
%  * @param q
%  * @return 
%  */
function [p corr_const] = hcm(a, b, m, n, r, k, q)
nbitsvar = 0;
for j = 0:n-1
    for i = 0:m-1
        if ((i+j) == (n+m-r-k-1))
            nbitsvar = nbitsvar + 1;
        end
    end
end
nbitsvar = round(nbitsvar * q);
corr_const = hcm_const(a,b,m,n,r,k,q,nbitsvar);
p = trunc_mult(a,b,corr_const, m,n,r,k);
end